#pragma once
#include <iostream>
#include <functional>
#include <thread>

using namespace std;

template <typename... Args>
void do_something(Args ... args)
{
	return;
}

struct func
{
	int& i;

	func(int& _i): i(_i)
	{
	}

	void operator()()
	{
		for (size_t i = 0; i < 999999999; i++)
		{
			do_something(i);
		}
	}
};

void oops()
{
	int some_local_state = 0;
	func my_func(some_local_state);
	std::thread my_thread(my_func);
	my_thread.detach();

}